package GUI;

import 学生.Student;
import 数据库和网络.myDatebase;
import 试题和试卷.paper;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.util.ArrayList;

public class chooseRankStudentItem extends JFrame {

    Student currentstudent;
    JButton reviseStudent;
    static chooseRankStudentItem chooseRankStudentItem;
    public  chooseRankStudentItem(int index,Student curr ){
        currentstudent =curr;
        reviseStudent = new JButton(curr.getName());
        reviseStudent.addActionListener(new stuChooseRankListener());
        int row = index/7+1;
        int col = index%7;
        reviseStudent.setBounds(100*col-50,50*row+50,80,30);
        reviseStudent.setBackground(Color.lightGray);
    }


    public class stuChooseRankListener implements ActionListener {
        @Override
        public void actionPerformed(ActionEvent e) {
            chooseRankStudentWindow.chooseRank.dispose();
            studentRank.rank = new studentRank(currentstudent);
            studentRank.rank.backButton.addActionListener(new backListener());

            //rankPaperItem item = new rankPaperItem(1,new paper());
           // rank.add(item);
        }
    }


    public class reviselistener implements ActionListener{

        @Override
        public void actionPerformed(ActionEvent e) {

        }
    }
    public class backListener implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {//关闭注册界面

            studentRank.rank.dispose();
            new teacherWindow("a");

        }
    }


}
